<<<<<<< HEAD
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); 
/**
 * 手机短信
 */
class Phone {
	
	function send($mobiles,$content,$sendTime=""){
		
		$sum = (int)$_COOKIE [$mobiles]?$_COOKIE [$mobiles]:0;
		if($sum > 19) {
			return '1';
		}
		else {
			$ctime = time () + 5*60*60; //限制5小时内获取多次次短信验证码
			setcookie ( $mobiles, $sum+1, $ctime);
		}
		
		$content = iconv("UTF-8","GBK",$content."【一点投】");
		$html = file_get_contents("http://www.112088.net:8088/sendsms_txt.asp?us_name=okydt&us_pwd=ediandai123&send_phone=$mobiles&send_content=".$content);
		$html= explode('|',$html);
		if($html[0] == '0' && $html[1] == '1' && $html[2] == '0'){
			return '0';
		}
		else {
			return '1';
		}
	}
	
	function  send1($mobile,$content,$sendTime=""){//美联
		$username = "";
		$password = "";
		$apikey = "";
		$url = 'http://m.5c.com.cn/api/send/?';
		$content = "【壹点投】".$content;
		$content = iconv("UTF-8","GBK",$content);
		$data = array
			(
			'username'=>$username,				//用户账号
			'password'=>$password,				//密码
			'mobile'=>$mobile,					//号码
			'content'=>$content,			//内容
			'apikey'=>$apikey,				    //apikey
			);
		$ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,$url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
		curl_setopt($ch, CURLOPT_TIMEOUT, 3600); //60秒 
        curl_setopt($ch, CURLOPT_HEADER,1);
        curl_setopt($ch, CURLOPT_REFERER,'http://www.yourdomain.com');
        curl_setopt($ch, CURLOPT_POST,1);
        curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
        $data = curl_exec($ch);
        curl_close($ch);
        $res = explode("\r\n\r\n",$data);
		if(strstr($res[2],'success')){
			return '0';
		}
		else {
			return '1';
		}
	}
	
=======
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); 
/**
 * 手机短信
 */
class Phone {
    
	function send($mobiles,$content,$sendTime=""){
		
		$sum = (int)$_COOKIE [$mobiles]?$_COOKIE [$mobiles]:0;
		if($sum > 19) {
			return '1';
		}
		else {
			$ctime = time () + 5*60*60; //限制5小时内获取多次次短信验证码
			setcookie ( $mobiles, $sum+1, $ctime);
		}
		
		$content = iconv("UTF-8","GBK","【一点投】".$content);
		$html = file_get_contents("http://www.112088.net:8088/sendsms_txt.asp?us_name=okydt&us_pwd=ediandai123&send_phone=$mobiles&send_content=".$content);
		$html= explode('|',$html);
		if($html[0] == '0' && $html[1] == '1' && $html[2] == '0'){
			return '0';
		}
		else {
			return '1';
		}
	}
	
	function  send1($mobile,$content,$sendTime=""){//美联
		$username = "";
		$password = "";
		$apikey = "";
		$url = 'http://m.5c.com.cn/api/send/?';
		$content = "【壹点投】".$content;
		$content = iconv("UTF-8","GBK",$content);
		$data = array
			(
			'username'=>$username,				//用户账号
			'password'=>$password,				//密码
			'mobile'=>$mobile,					//号码
			'content'=>$content,			//内容
			'apikey'=>$apikey,				    //apikey
			);
		$ch = curl_init();
        curl_setopt($ch, CURLOPT_URL,$url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
		curl_setopt($ch, CURLOPT_TIMEOUT, 3600); //60秒 
        curl_setopt($ch, CURLOPT_HEADER,1);
        curl_setopt($ch, CURLOPT_REFERER,'http://www.yourdomain.com');
        curl_setopt($ch, CURLOPT_POST,1);
        curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
        $data = curl_exec($ch);
        curl_close($ch);
        $res = explode("\r\n\r\n",$data);
		if(strstr($res[2],'success')){
			return '0';
		}
		else {
			return '1';
		}
	}
	
>>>>>>> d47623b610d79a4eeb489500830c00d70933f414
}